<script setup>

import { onMounted, defineEmits, ref } from 'vue';

const emit = defineEmits(['c-mounted', 'update:childrenName'])
const props = defineProps({
    childrenName: String
});

onMounted(() => {
    console.log('子组件生命周期')
})
const emitHandle = () => {
    emit('update:childrenName', props.childrenName + '778899')
}
</script>

<template>
    <div>
        父组件监听子组件生命周期 

        <!-- <el-input v-model="props.childrenName" @change="emitHandle"></el-input> -->
        <el-button type="primary" @click="emitHandle">执行emit
        </el-button>
    </div>
</template>

<style scoped lang="scss"></style>